import javax.swing.*;

public class EmployeeTest {
    public static void main(String[] args) {
        Employee[] employee =new Employee[3];
//        for (int i=0;i<employee.length;i++){
//            String name = JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个员工姓名");
//            String job = JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个员工职位");
//            int salary = Integer.parseInt(JOptionPane.showInputDialog(null,"请输入第"+(i+1)+"个员工工资"));
//
//            Employee em = new Employee();
//            em.name = name;
//            em.job = job;
//            em.salary = salary;
//            employee[i] = em;
//        }
//        String result = "姓名   职位   工资\n";
//        for (int i=0;i<employee.length;i++){
//            Employee e = employee[i];
////            result += employee[i].name+"  "+employee[i].job+"  "+employee[i].salary+"\n";
//            result += e.name+"  "+e.job+"  "+e.salary+"\n";
//        }
//
////        //for each方法(只能从第一个开始)
////        for (Employee a:employee){
////
////            result += a.name+"  "+a.job+"  "+a.salary+"\n";
////        }
//
//        JOptionPane.showMessageDialog(null,result);

    }

}
